﻿using log4net;
using System;

namespace MqResearchCSharp.ActiveMq.ActiveMQ
{
    public class OtcLog
    {
        private ILog _log;
        private string _head = "";
        public OtcLog(Type type)
        {
            _log = LogManager.GetLogger(type);
        }
        public OtcLog(string loggerName)
        {
            _log = LogManager.GetLogger(loggerName);
        }

        public void BindHead(string head)
        {
            _head = head;
        }
        public void Debug(string msg)
        {
            _log.Debug($@"{_head},{msg}");
        }
        public void Info(string msg)
        {
            _log.Info($@"{_head},{msg}");
        }
        public void Error(string msg)
        {
            _log.Error($@"{_head},{msg}");
        }
        public void Warn(string msg)
        {
            _log.Warn($@"{_head},{msg}");
        }
    }
}
